#define _CRT_SECURE_NO_WARNINGS  1
#pragma warning(disable:6031)
#include<stdio.h>


int missingNumber(int* nums, int numsSize) {
    int sum = (numsSize + 1) / 2 * numsSize;
    for (int i = 0; i < numsSize; i++)
    {
        sum -= nums[i];
    }
    return sum;
}
int main()
{
    int nums[] = { 0,1,2 };
    int n = 3;
    int k = missingNumber(nums, n);
    printf("%d", k);

	return 0;
}